/**
 * @Author: Bobby
 * @Date: 2022-02-15 13:14:17
 * @LastEditTime: 2022-03-01 10:17:51
 * @LastEditors: Bobby
 * @Description:
 * @FilePath: \wms-v2\src\ve\common\components\baseComs\form\uiCheckbox.js
 * @CIMC-V2
 */
import { exInput, exSwitch, exSizeSelect, exTextarea, exValidateSelect, exRequestData } from '@ve/common/components/extension'

export default {
  VERSION: '20220408',
  type: 'uiCheckbox',
  name: '多选',
  icon: 'checkbox-line',
  //数据别名
  // dataName: 'uiCheckbox_data',
  //数据集合 表单 列表等等
  data: {
    requestData: {},
  },
  extension: {
    model: exInput('Model', 'checkbox_name'),
    label: exInput('标签', '多选'),
    //rule: exSwitch('验证', false),
    extendRule: exValidateSelect('', {}, []),
    // ...exDivider(0),
    value: exInput('值', '1'),
    tooltip: exTextarea('弹窗提示', '', '', 3),
    width: exInput('宽度', 'auto', '填写数字:单位px,auto:自动宽度'),
    labelWidth: exInput('label宽度', 'auto', '填写数字:单位px,auto:自动宽度'),
    jsonList: {
      type: 'exJsonList',
      name: '默认数据',
      // 格式
      format: [
        {
          name: '名称',
          value: 'label',
          type: '',
        },
        {
          name: '值',
          value: 'value',
          type: '',
        },
      ],
      value: [
        {
          label: '名称',
          value: '123',
        },
      ],
    },
    size: exSizeSelect('尺寸', 'mini'),
    disabled: exSwitch('禁用', false),
    hidden: exSwitch('隐藏', false),
    ignoreClearValue: exSwitch('忽略清空', false, '开启后清空表单会保留默认值'),
    defaultValue: exInput('默认值', '', '如需选择多个值请用 , 连接'),
    labelField: exInput('label字段', 'label'),
    valueField: exInput('value字段', 'value'),
    api: exInput('Api接口', ''),
    method: exInput('Method', ''),
    getDataKey: exInput('获取数据Key', ''),
    requestData: exRequestData('参数', [
      { key: '#LIMIT#', value: 1 },
      { key: '#PAGE_SIZE#', value: 50 },
    ]),
    enterSelect: {
      type: 'exModuleSelect',
      name: '回车选中',
      value: [],
      hasCheckbox: false,
      treeData: '$getPageModules',
      isSuperior: true,
    },
  },
  //交互
  interaction: [],
  //条件、逻辑指令
  logicInstruction: [],
}
